package org.example.member.dao;


import org.apache.ibatis.annotations.Param;
import org.example.member.entity.MemberReceiveAddressEntity;

import java.util.List;

/**
 * @author xiaojie_cc
 * @version 1.0
 */
public interface MemberReceiveAddressDao{

    // 获取对应会员地址
    List<MemberReceiveAddressEntity> getAddressByMemberId(@Param("memberId") Long memberId);

    //根据地址id查询地址信息
    MemberReceiveAddressEntity getAddressInfoById(@Param("addressId") Long addressId);

    // 修改地址信息
    int updateMemberAddress(@Param("id") Long id, @Param("address") MemberReceiveAddressEntity memberReceiveAddress,@Param("memberId") long memberId);

    // 修改默认地址信息
    void updateAddressStatus(@Param("memberId") long memberId);

    // 新增地址信息
    int addMemberAddress(@Param("memberId") long memberId, @Param("address") MemberReceiveAddressEntity memberReceiveAddress);

    // 删除收货地址
    int deleteMemberAddress(@Param("id") Long id, @Param("memberId") long memberId);

}
